package com.jingtai.shop.webfacade.bo.user;

import com.jingtai.common.webfacade.BaseBO;
import com.jingtai.common.webfacade.error.CommonException;
import com.jingtai.common.webfacade.error.ErrorEnum;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * 用户登录入参
 */
@Data
public class UserLoginBO extends BaseBO {

    /**
     * 用户名/手机号
     */
    private String userName;
    /**
     * 密码
     */
    private String password;


    @Override
    public void validate() {
        super.validate();
        if (StringUtils.isEmpty(userName) || StringUtils.isEmpty(password)){
            throw new CommonException(ErrorEnum.REQUIRED_PARAM_EMPTY);
        }
    }
}
